//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package fxlauncher;

import javafx.scene.Node;
import javafx.scene.Parent;
import javafx.scene.control.ProgressBar;
import javafx.scene.image.ImageView;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;

public class DefaultUIProvider implements UIProvider {
	private ProgressBar progressBar;

	public DefaultUIProvider() {
	}

	public Parent createLoader() {
		VBox root = new VBox();
		ImageView imageView = new ImageView(this.getClass().getResource(this.getImagePath()).toExternalForm());
		this.progressBar = new ProgressBar();
		this.progressBar.setPrefWidth(imageView.getImage().getWidth());
		root.getChildren().addAll(new Node[]{imageView, this.progressBar});
		return root;
	}

	public Parent createUpdater(FXManifest manifest) {
		return null;
	}

	public void updateProgress(double progress) {
		this.progressBar.setProgress(progress);
	}

	public void init(Stage stage) {
	}

	private String getImagePath() {
		return "/splash.png";
	}
}
